package com.ac.scum.log.web.model.wechat.mp.mapper;

import com.ac.scum.log.bean.Player;
import com.ac.scum.wechat.bean.WeChatUser;
import com.ac.scum.wechat.bean.WechatUserPlayer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface WeChatUserPlayerMapper extends BaseMapper<WechatUserPlayer> {

    @Select("select * from wechat_mp_user where open_id = (select open_id from wechat_user_player where steam_id = #{steamId} limit 1)")
    WeChatUser selectWechatUserBySteamId(@Param("steamId") Long steamId);

    @Select("select * from player where steam_id = (select steam_id from wechat_user_player where open_id = #{openId} limit 1)")
    Player selectPlayerByOpenId(@Param("openId") String openId);
}
